op-node: fix sync heads starting point [bedrock]#3320
op-node: fix sync heads starting point [bedrock]#3320protolambda wants to merge 2 commits intodevelopfrom
Conversation
|
|
This PR changes implementation code, but doesn't include a changeset. Did you forget to add one? |
51c4442 to
93715b0
Compare
|
Hey @protolambda! This PR has merge conflicts. Please fix them before continuing review. |
59691db to
b0cd4ee
Compare
…correctly, and fix off-by-1 in epoch window boundary
b0cd4ee to
93aabb4
Compare
|
Hey @protolambda! This PR has merge conflicts. Please fix them before continuing review. |
|
This has been replaced. |
Description
This PR fixes the way we find the L2 block that we start syncing on top of.
Off by one fix in safe head
As I was working on tests for the finalization, I found that the safe-head sync algorithm has an off-by-one error:
We need to reset one L2 block deeper, to force all previous safe L1 blocks (only those that we can't be sure of with inclusion even though their L1 origin is canonical) to be reconciled against L1, to ensure they are still included on the new canonical L1 chain.
Safe block RPC label usage
Currently we're also just doing the above starting at the unsafe head instead of safe head, meaning the off-by-one error can be higher if we happen to have a long unsafe chain that still references canonical L1 data but isn't actually submitted on-chain.
This is a long-due fix for a workaround that couldn't be fixed due to the lack of support for the
safeblock label in the geth RPC.Finalized block check
The initialization of the finalized info is now part of the sync start algorithm, since we need to check if we don't revert it accidentally.
Metadata
Fix ENG-2671